#!/bin/sh
############################################################################
#
# Just Another Package Builder
#
# Build script
#
# $Id: build.tcl,v 8d897af5ccaf 2011/12/24 11:07:43 al $
#
############################################################################
# \
exec ./japb.tcl "$0" "$@"

use extension hg

# determine package version
set f [open lib/japb.tcl r]
set data [read $f]
close $f

if {![regexp {package provide japb ([0-9]+(\.[0-9]+){1,2})} $data _ version]} {
    error "Unable to determine version"
}

init {*}$argv

set name japb-$version

if {[file isdirectory wiki]} {
    set wikiList wiki
} else {
    set wikiList {}
}
output [dir $name \
    lib \
    {*}$wikiList \
]

if {[hg isUnderVcs]} {
    output [hg archive zip $name]
}

clean

# vim: set ft=tcl:
